﻿/**
 * Created in 2012-2-20.
 */
package kit4j.tests.jdk.console;

import java.util.Enumeration;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

/**
 * 
 * @author MiniKnife
 *
 */
public class TestSystemProperties {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		showSystemProperties();
	}
	
	static void showSystemProperties() {
		Properties p = System.getProperties();
		
		String name = null;
		for(Enumeration<?> names = p.propertyNames(); names.hasMoreElements();) {
			name = names.nextElement().toString();
			System.out.println(name + " : " +p.getProperty(name));
		}
	}
	
	static void showSystemEnv() {
		Map<String, String> envMap = System.getenv();
		Set<Map.Entry<String, String>> envSet = envMap.entrySet();
		
		for(Map.Entry<String, String> env : envSet) {
			System.out.println("[" + env.getKey() + "] : " + env.getValue());
		}
	}

}
